home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / OUE8V6 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.9 KB  |  49 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import java.awt.Component;
  5. import java.awt.Graphics;
  6. import java.io.Serializable;
  7.  
  8. public class MetalIconFactory$FileIcon16 implements Icon, Serializable {
  9.    public void paintIcon(Component c, Graphics g, int x, int y) {
  10.       g.translate(x, y + this.getShift());
  11.       int right = MetalIconFactory.access$fileIcon16Size().width - 1;
  12.       int bottom = MetalIconFactory.access$fileIcon16Size().height - 1;
  13.       g.setColor(MetalLookAndFeel.getWindowBackground());
  14.       g.fillRect(4, 2, 9, 12);
  15.       g.setColor(MetalLookAndFeel.getPrimaryControlInfo());
  16.       g.drawLine(2, 0, 2, bottom);
  17.       g.drawLine(2, 0, right - 4, 0);
  18.       g.drawLine(2, bottom, right - 1, bottom);
  19.       g.drawLine(right - 1, 6, right - 1, bottom);
  20.       g.drawLine(right - 6, 2, right - 2, 6);
  21.       g.drawLine(right - 5, 1, right - 4, 1);
  22.       g.drawLine(right - 3, 2, right - 3, 3);
  23.       g.drawLine(right - 2, 4, right - 2, 5);
  24.       g.setColor(MetalLookAndFeel.getPrimaryControl());
  25.       g.drawLine(3, 1, 3, bottom - 1);
  26.       g.drawLine(3, 1, right - 6, 1);
  27.       g.drawLine(right - 2, 7, right - 2, bottom - 1);
  28.       g.drawLine(right - 5, 2, right - 3, 4);
  29.       g.drawLine(3, bottom - 1, right - 2, bottom - 1);
  30.       g.translate(-x, -(y + this.getShift()));
  31.    }
  32.  
  33.    public int getShift() {
  34.       return 0;
  35.    }
  36.  
  37.    public int getAdditionalHeight() {
  38.       return 0;
  39.    }
  40.  
  41.    public int getIconWidth() {
  42.       return MetalIconFactory.access$fileIcon16Size().width;
  43.    }
  44.  
  45.    public int getIconHeight() {
  46.       return MetalIconFactory.access$fileIcon16Size().height + this.getAdditionalHeight();
  47.    }
  48. }
  49.